/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
*
*
* Authors:                  zhoujian
* Email:            343600434@qq.com
* Date:         Jan-25-2024 11:11:52
*
*/


#ifndef __key_H__
#define __key_H__




#ifdef __cplusplus
extern "C" {
#endif



typedef void (*p_func)(void);
typedef struct key_info_type {
    uint8_t down_times;
    uint8_t up_times;
    uint8_t count;
    uint8_t key_init;
    p_func func;
    p_func func_long;
} KEY_TYPE;

#define UP_CHECK_TIME_10MS 8
#define UP_CHECK_TIMES 5

#define DOWN_CHECK_TIME_10MS 10
#define DOWN_CHECK_TIMES 5

#define DOWN_CHECK_TIMES_LONG 150

void init_key();
void key_handle(void);
void key_down_start(uint8_t index);



extern KEY_TYPE key_st[KEYn];





#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
class key
{

public:
    key();
    ~key();

};
#endif



#endif
